package figures;

import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;

/**
 * this class holds references to all figure images
 */
public class Imgs {

    /**
     * the BufferedImage of the black bishop
     */
    public static BufferedImage BISHOP_B;
    /**
     * the BufferedImage of the white bishop
     */
    public static BufferedImage BISHOP_W;
    /**
     * the BufferedImage of the black horse
     */
    public static BufferedImage HORSE_B;
    /**
     * the BufferedImage of the white horse
     */
    public static BufferedImage HORSE_W;
    /**
     * the BufferedImage of the black king
     */
    public static BufferedImage KING_B;
    /**
     * the BufferedImage of the white king
     */
    public static BufferedImage KING_W;
    /**
     * the BufferedImage of the black pawn
     */
    public static BufferedImage PAWN_B;
    /**
     * the BufferedImage of the white pawn
     */
    public static BufferedImage PAWN_W;
    /**
     * the BufferedImage of the black queen
     */
    public static BufferedImage QUEEN_B;
    /**
     * the BufferedImage of the white queen
     */
    public static BufferedImage QUEEN_W;
    /**
     * the BufferedImage of the black tower
     */
    public static BufferedImage TOWER_B;
    /**
     * the BufferedImage of the white tower
     */
    public static BufferedImage TOWER_W;

    /**
     * initializes the buffered images of all figures in a static way
     */
    static
    {
	try
	{
	    BISHOP_B = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/bishop_b.png" ) );
	    BISHOP_W = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/bishop_w.png" ) );
	    HORSE_B = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/horse_b.png" ) );
	    HORSE_W = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/horse_w.png" ) );
	    KING_B = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/king_b.png" ) );
	    KING_W = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/king_w.png" ) );
	    PAWN_B = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/pawn_b.png" ) );
	    PAWN_W = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/pawn_w.png" ) );
	    QUEEN_B = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/queen_b.png" ) );
	    QUEEN_W = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/queen_w.png" ) );
	    TOWER_B = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/tower_b.png" ) );
	    TOWER_W = ImageIO.read( ClassLoader.getSystemResourceAsStream( "figures/tower_w.png" ) );
	}
	catch ( IOException e )
	{
	    e.printStackTrace();
	}
    }

}
